<?
	include_once("Clases/Alumno.php");
	session_start();
	$form_alumno = $_SESSION["form_alumno"];
	$errores_alumno = $_SESSION["errores_alumno"];
	
	if(!isset($form_alumno)){
		$form_alumno = new Alumno("", "", "", "", "");
	}
	
	$_SESSION["form_alumno"] = $form_alumno;
	
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
		<title>Registro de Alumno</title>
		<script type="text/javascript" src="Javascript/validaAlumno.js"></script>
	</head>
	<body>
		<div id="div_errores">
			<?	if(isset($errores_alumno)){
					foreach($errores_alumno as $error){
						print("<div class='error'>");
						print("$error");
						print("</div>");	
					}
				}
			?>
		</div>
		<form id="form_alumno" onsubmit="return procesaFormulario()" action="Tratamiento/tratamientoAlumno.php?action=insert" method="post" enctype="application/x-www-form-urlencoded">
			<label>Nombre:
				<input id="nombre" name="nombre" type="text" value='<?= $form_alumno->nombre?>'/>
			</label>
			<label>Apellidos:
				<input id="apellidos" name="apellidos" type="text" value='<?= $form_alumno->apellidos?>'/>
			</label>
			<label>E-mail:
				<input id="email" name="email" type="text" value='<?= $form_alumno->email?>'/>
			</label>
			<label>Contraseña:
				<input id="password" name="password" type="password" value=""/>
			</label>
			<label>Repita contraseña:
				<input id="repitepassword" name="repitepassword" type="password" value=""/>
			</label>
			<input type="submit" />
		</form>
	</body>
</html>